package cn.funeralobjects.aoss.enums;

import lombok.Getter;

/**
 * 存储类型
 *
 * @author FuneralObjects
 * Create date: 2020/6/1 9:47 AM
 */
public enum StorageClass {
    /**
     * 标准
     */
    STANDARD("Standard"),
    /**
     * 低频
     */
    IA("IA"),
    /**
     * 归档
     */
    ARCHIVE("Archive"),
    /**
     * 未知
     */
    UNKNOWN("Unknown");

    /**
     * 字串
     */
    @Getter
    private final String storageClassString;

    StorageClass(String storageClassString) {
        this.storageClassString = storageClassString;
    }


    public static StorageClass of(String storageClassString) {
        if (storageClassString == null) {
            return null;
        }
        for (StorageClass storageClass : StorageClass.values()) {
            if (storageClass.storageClassString.equals(storageClassString)) {
                return storageClass;
            }
        }
        return null;
    }
}

